<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        .c{
            width: 100%;
            height: 2000px;
        }
        .a{
            width: 100%;
            height: 400px;
            background-color: blue;
        }
        .b{
            width: 100%;
            height: 400px;
            background-color: yellow;
            
            position: sticky;
            left: 0;
            top: 0px;
        }
    </style>
</head>
<body>
    <div class="c">
        <div class="a"></div>
        <div class="b"></div>
    </div>
</body>
</html>